gen unhfood = howmanytimesaweekdoyoueatcakebis + howmanytimesaweekdoyoueaticecrea + howmanytimesaweekdoyoueatchocola + howmanytimesaweekdoyoueatcrisps + howmanytimesaweekdoyoueatcracke
 

*Check the models to choose the best

**Binary measure in Tables 3-5 (separate do file on full original dataset)

**TABLE 3
mixed spprob condition || subject: || chall: condition
estat ic

mixed spprob condition || subject: || chall: condition, cov(un)
estat ic

mixed spprob condition || subject: || chall: condition, nocon
estat ic

mixed spprob condition || subject: || chall: condition, cov(un) nocon
estat ic

mixed spprob condition || subject: || chall: , nocon
estat ic

mixed spprob condition || subject: || chall: , cov(un) nocon
estat ic

mixed spprob condition || subject: || chall: , 
estat ic

mixed spprob condition || subject: || chall: , cov(un) 
estat ic
 
**apr1:
mixed spprob condition || subject: || chall:
estat ic
**apr 2: 
mixed spprob condition || subject: || chall: condition
estat ic
**apr 3:
mixed spprob condition || subject: || chall: condition, cov(un)
estat ic


**TABLE 4
mixed ph condition || subject: || chall: condition
estat ic

mixed ph condition || subject: || chall: condition, cov(un)
estat ic

mixed ph condition || subject: || chall: condition, nocon
estat ic

mixed ph condition || subject: || chall: condition, cov(un) nocon
estat ic

mixed ph condition || subject: || chall: , nocon
estat ic

mixed ph condition || subject: || chall: , cov(un) nocon
estat ic

mixed ph condition || subject: || chall: , 
estat ic

mixed ph condition || subject: || chall: , cov(un) 
estat ic

**apr1:
 mixed ph condition || subject: || chall:
 estat ic
**apr2:
mixed ph condition || subject: || chall:
estat ic
**apr3:
 mixed ph condition || subject: || chall: condition, cov(un)
estat ic



**TABLE 5
mixed scprob condition unhfood || subject: || chall: condition
estat ic

mixed scprob  condition unhfood   || subject: || chall: condition, cov(un)
estat ic

mixed scprob  condition unhfood   || subject: || chall: condition, nocon
estat ic

mixed scprob  condition unhfood   || subject: || chall: condition, cov(un) nocon
estat ic

mixed scprob condition unhfood   || subject: || chall: , nocon
estat ic

mixed scprob condition unhfood   || subject: || chall: , cov(un) nocon
estat ic

mixed scprob condition unhfood   || subject: || chall: , 
estat ic

mixed scprob condition unhfood   || subject: || chall: , cov(un) 
estat ic
  
**apr1:
mixed scprob condition unhfood || subject: || chall: condition
estat ic
mixed scprob condition##c.unhfood || subject: || chall: condition##c.unhfood
*no interact
**apr2:
mixed scprob condition unhfood || subject: || chall: condition
estat ic
mixed scprob condition##c.unhfood || subject: || chall: condition##c.unhfood
*no interact 
**apr3:
 mixed scprob  condition unhfood   || subject: || chall: condition, cov(un)
 estat ic
 mixed scprob  condition##c.unhfood   || subject: || chall: condition##c.unhfood , cov(un)
 *can't calculate
  mixed scprob  condition##c.unhfood   || subject: || chall: condition##c.unhfood ,
   mixed scprob  condition##c.unhfood   || subject: || chall: 
   *no interact in bot 2nd best
     
    
**TABLE S3a
mixed spprob condition if chall==0 || subject:  condition
estat ic

mixed spprob condition if chall==0 || subject:  condition, cov(un)
estat ic

mixed spprob condition if chall==0 || subject:  condition, nocon
estat ic

mixed spprob condition if chall==0 || subject:  condition, cov(un) nocon
estat ic

mixed spprob condition if chall==0 || subject:  , nocon
estat ic

mixed spprob condition if chall==0 || subject:  , cov(un) nocon
estat ic

mixed spprob condition if chall==0 || subject:  , 
estat ic

mixed spprob condition if chall==0 || subject:  , cov(un) 
estat ic

**apr1:
mixed spprob condition if chall==0 || subject: 
estat ic
**apr2:
mixed spprob condition if chall==0 || subject:
estat ic
**apr3:
mixed spprob condition if chall==0 || subject:
estat ic


**TABLE S3b
mixed spprob condition if chall==1 || subject:  condition
estat ic

mixed spprob condition if chall==1 || subject:  condition, cov(un)
estat ic

mixed spprob condition if chall==1 || subject:  condition, nocon
estat ic

mixed spprob condition if chall==1 || subject:  condition, cov(un) nocon
estat ic

mixed spprob condition if chall==1 || subject:  , nocon
estat ic

mixed spprob condition if chall==1 || subject:  , cov(un) nocon
estat ic

mixed spprob condition if chall==1 || subject:  , 
estat ic

mixed spprob condition if chall==1 || subject:  , cov(un) 
estat ic

**apr1:
mixed spprob condition if chall==1 || subject:
estat ic
**apr2:
 mixed spprob condition if chall==1 || subject:  condition
 estat ic
**apr3:
mixed spprob condition if chall==1 || subject:  , cov(un) 
estat ic
    
 
**TABLE S4a
mixed ph condition if chall==0 || subject:  condition
estat ic

mixed ph condition if chall==0 || subject:  condition, cov(un)
estat ic

mixed ph condition if chall==0 || subject:  condition, nocon
estat ic

mixed ph condition if chall==0 || subject:  condition, cov(un) nocon
estat ic

mixed ph condition if chall==0 || subject:  , nocon
estat ic

mixed ph condition if chall==0 || subject:  , cov(un) nocon
estat ic
 
mixed ph condition if chall==0 || subject:  , 
estat ic

mixed ph condition if chall==0 || subject:  , cov(un) 
estat ic

**apr1:
mixed ph condition if chall==0 || subject:  condition
estat ic
**apr2:
mixed ph condition if chall==0 || subject:  condition
estat ic
**apr3:
mixed ph condition if chall==0 || subject: 
estat ic

**TABLE S4b
mixed ph condition if chall==1 || subject:  condition
estat ic

mixed ph condition if chall==1 || subject:  condition, cov(un)
estat ic

mixed ph condition if chall==1 || subject:  condition, nocon
estat ic

mixed ph condition if chall==1 || subject:  condition, cov(un) nocon
estat ic

mixed ph condition if chall==1 || subject:  , nocon
estat ic

mixed ph condition if chall==1 || subject:  , cov(un) nocon
estat ic

mixed ph condition if chall==1 || subject:  , 
estat ic

mixed ph condition if chall==1 || subject:  , cov(un) 
estat ic

 
**apr1:
 mixed ph condition if chall==1 || subject:  condition, cov(un)
 estat ic
**apr2:
mixed ph condition if chall==1 || subject: 
estat ic
**apr3 (can't calculate 2nd model):
 mixed ph condition if chall==1 || subject: 
 estat ic


**TABLE S5 - on full original dataset (separate do file)


**TABLE S6
mixed pt condition || subject: || chall: condition
estat ic

mixed pt condition || subject: || chall: condition, cov(un)
estat ic

mixed pt condition || subject: || chall: condition, nocon
estat ic

mixed pt condition || subject: || chall: condition, cov(un) nocon
estat ic

mixed pt condition || subject: || chall: , nocon
estat ic

mixed pt condition || subject: || chall: , cov(un) nocon
estat ic

mixed pt condition || subject: || chall: , 
estat ic

mixed pt condition || subject: || chall: , cov(un) 
estat ic
 
**apr1:
mixed pt condition || subject: || chall: condition
estat ic
**apr2: 
mixed pt condition || subject: || chall: condition
estat ic
**apr3:
 mixed pt condition || subject: || chall:
 estat ic

  
**TABLE S7a
mixed pt condition if chall==0 || subject:  condition
estat ic

mixed pt condition if chall==0 || subject:  condition, cov(un)
estat ic

mixed pt condition if chall==0 || subject:  condition, nocon
estat ic

mixed pt condition if chall==0 || subject:  condition, cov(un) nocon
estat ic

mixed pt condition if chall==0 || subject:  , nocon
estat ic

mixed pt condition if chall==0 || subject:  , cov(un) nocon
estat ic

mixed pt condition if chall==0 || subject:  , 
estat ic

mixed pt condition if chall==0 || subject:  , cov(un) 
estat ic

**apr1:
mixed pt condition if chall==0 || subject:  condition, cov(un)
estat ic
**apr2:
mixed pt condition if chall==0 || subject:  condition
estat ic
**apr3:
mixed pt condition if chall==0 || subject:  condition, cov(un)
estat ic


**TABLE S7b
mixed pt condition if chall==1 || subject:  condition
estat ic

mixed pt condition if chall==1 || subject:  condition, cov(un)
estat ic

mixed pt condition if chall==1 || subject:  condition, nocon
estat ic

mixed pt condition if chall==1 || subject:  condition, cov(un) nocon
estat ic

mixed pt condition if chall==1 || subject:  , nocon
estat ic

mixed pt condition if chall==1 || subject:  , cov(un) nocon
estat ic

mixed pt condition if chall==1 || subject:  , 
estat ic

mixed pt condition if chall==1 || subject:  , cov(un) 
estat ic

**apr1:
mixed pt condition if chall==1 || subject:
estat ic
**apr2:
mixed pt condition if chall==1 || subject:
estat ic
**apr3: 
mixed pt condition if chall==1 || subject:  condition, cov(un)
estat ic


**TABLE S8 - on full original dataset (separate do file)

 
**TABLE S9
mixed scprob condition || subject: || chall: condition
estat ic

mixed scprob condition || subject: || chall: condition, cov(un)
estat ic

mixed scprob condition || subject: || chall: condition, nocon
estat ic

mixed scprob condition || subject: || chall: condition, cov(un) nocon
estat ic

mixed scprob condition || subject: || chall: , nocon
estat ic

mixed scprob condition || subject: || chall: , cov(un) nocon
estat ic

mixed scprob condition || subject: || chall: , 
estat ic

mixed scprob condition || subject: || chall: , cov(un) 
estat ic

*apr1:
mixed scprob condition || subject: || chall: condition
estat ic
**apr2:
mixed scprob condition || subject: || chall: condition
estat ic
**apr3:
mixed scprob condition || subject: || chall: condition, cov(un)
estat ic

  
**TABLE S10a
mixed scprob condition if chall==0 || subject:  condition
estat ic

mixed scprob condition if chall==0 || subject:  condition, cov(un)
estat ic

mixed scprob condition if chall==0 || subject:  condition, nocon
estat ic

mixed scprob condition if chall==0 || subject:  condition, cov(un) nocon
estat ic

mixed scprob condition if chall==0 || subject:  , nocon
estat ic

mixed scprob condition if chall==0 || subject:  , cov(un) nocon
estat ic

mixed scprob condition if chall==0 || subject:  , 
estat ic

mixed scprob condition if chall==0 || subject:  , cov(un) 
estat ic

*apr1:
mixed scprob condition if chall==0 || subject:  condition
estat ic
**apr2:
mixed scprob condition if chall==0 || subject:  condition
estat ic
**apr3:
mixed scprob condition if chall==0 || subject:  condition, cov(un)
estat ic


**TABLE S10b
mixed scprob condition if chall==1 || subject:  condition
estat ic

mixed scprob condition if chall==1 || subject:  condition, cov(un)
estat ic

mixed scprob condition if chall==1 || subject:  condition, nocon
estat ic

mixed scprob condition if chall==1 || subject:  condition, cov(un) nocon
estat ic

mixed scprob condition if chall==1 || subject:  , nocon
estat ic

mixed scprob condition if chall==1 || subject:  , cov(un) nocon
estat ic

mixed scprob condition if chall==1 || subject:  , 
estat ic

mixed scprob condition if chall==1 || subject:  , cov(un) 
estat ic

**apr1:
mixed scprob condition if chall==1 || subject:  condition, cov(un)
 estat ic
**apr2:
 mixed scprob condition if chall==1 || subject: 
 estat ic
 **apr3:
 mixed scprob condition if chall==1 || subject:  condition, cov(un)
 estat ic
  
 
**TABLES 11-13

**FIRST TABLE-ROW (interaction checked on the best model)

mixed scprob condition unhfood if chall==0 || subject:  condition
estat ic

mixed scprob condition unhfood if chall==0 || subject:  condition, cov(un)
estat ic

mixed scprob condition unhfood if chall==0 || subject:  condition, nocon
estat ic

mixed scprob condition unhfood if chall==0 || subject:  condition, cov(un) nocon
estat ic

mixed scprob condition unhfood if chall==0 || subject:  , nocon
estat ic

mixed scprob condition unhfood if chall==0 || subject:  , cov(un) nocon
estat ic

mixed scprob condition unhfood if chall==0 || subject:  , 
estat ic

mixed scprob condition unhfood if chall==0 || subject:  , cov(un) 
estat ic
  
**apr1:
mixed scprob condition unhfood if chall==0 || subject:  condition
estat ic
mixed scprob condition##c.unhfood if chall==0 || subject:  condition##c.unhfood
*no interact
   
**apr2:
mixed scprob condition unhfood if chall==0 || subject:  condition
estat ic
mixed scprob condition##c.unhfood if chall==0 || subject:  condition##c.unhfood
*no interact
*below (similar aic/bic as above) same result, can't calculate interaction
mixed scprob condition unhfood if chall==0 || subject:  condition, cov(un)
estat ic
mixed scprob condition##c.unhfood if chall==0 || subject:  condition##c.unhfood,cov(un)
*can't calculate

**apr3
 mixed scprob condition unhfood if chall==0 || subject:  condition, cov(un)
 estat ic
  mixed scprob condition##c.unhfood if chall==0 || subject:  condition##c.unhfood, cov(un)
  *can't calculate
  mixed scprob condition##c.unhfood if chall==0 || subject:  condition##c.unhfood,
mixed scprob condition##c.unhfood if chall==0 || subject:  
*no interact in 2nd-best models
 

mixed scprob condition unhfood if chall==1 || subject:  condition
estat ic

mixed scprob condition unhfood if chall==1 || subject:  condition, cov(un)
estat ic
 
mixed scprob condition unhfood if chall==1 || subject:  condition, nocon
estat ic

mixed scprob condition unhfood if chall==1 || subject:  condition, cov(un) nocon
estat ic

mixed scprob condition unhfood if chall==1 || subject:  , nocon
estat ic

mixed scprob condition unhfood if chall==1 || subject:  , cov(un) nocon
estat ic

mixed scprob condition unhfood if chall==1 || subject:  , 
estat ic

mixed scprob condition unhfood if chall==1 || subject:  , cov(un) 
estat ic

**apr1:
mixed scprob condition unhfood if chall==1 || subject:  condition, cov(un)
estat ic
 mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood, cov(un)
 *can't calculate
 mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood,
mixed scprob condition##c.unhfood if chall==1 || subject: 
*no interact in 2nd-best models

**apr2:
mixed scprob condition unhfood if chall==1 || subject:  condition, cov(un)
estat ic
mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood, cov(un)
*can't calculate
mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood,
mixed scprob condition##c.unhfood if chall==1 || subject:  
*no interact in 2nd-best models

**apr3:
mixed scprob condition unhfood if chall==1 || subject:  condition, cov(un)
estat ic
mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood, cov(un)
*can't calculate
mixed scprob condition##c.unhfood if chall==1 || subject:  condition##c.unhfood,
mixed scprob condition##c.unhfood if chall==1 || subject:  
*no interact in 2nd-best models


**SECOND TABLE-ROW
 mixed scprob   unhfood  if chall==0&condition==0 || subject: 
 mixed scprob   unhfood  if chall==1&condition==0 || subject: 
	 
	
**THIRD TABLE-ROW
 mixed scprob   unhfood  if chall==0&condition==1|| subject: 
 mixed scprob   unhfood  if chall==1&condition==1 || subject: 

*apr1: all significant
*apr2: all significant
*apr3: all significant

 
 
***CHECK OTHER MEASURES
  
*tfeq_cognitive_restraint tfeq_uncontrolled_eating tfeq_emotional_eating supps_np supps_p supps_w supps_pd supps_pp pfs_pfsmean pfs_foodavailable pfs_foodpresent pfs_foodtasted panas_pa panas_na panas_sadness panas_fear panas_hostility panas_joy panas_attentiveness nfc scsscore digit_span_forward digit_span_backward digit_span_all 

gen x = tfeq_cognitive_restraint
gen y = scprob

mixed y condition x || subject: || chall: condition
estat ic

mixed y  condition x  || subject: || chall: condition, cov(un)
estat ic

mixed y  condition x   || subject: || chall: condition, nocon
estat ic

mixed y  condition x   || subject: || chall: condition, cov(un) nocon
estat ic

mixed y condition x   || subject: || chall: , nocon
estat ic

mixed y condition x  || subject: || chall: , cov(un) nocon
estat ic

mixed y condition x   || subject: || chall: , 
estat ic

mixed y condition x   || subject: || chall: , cov(un) 
estat ic

drop x
drop y

*apr1 - apr3: nothing significant, no trends < 0.1
